/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Form_MainMenu.java
 *
 * Created on 11 10, 11, 6:43:10 PM
 */

package introsemp;
import java.util.ArrayList;
import javax.swing.table.*;
import javax.swing.*;
import java.sql.*;
import java.util.Properties;  
import java.io.*;
import java.util.*;
import java.io.PrintWriter;
import java.awt.*;

/**
 *
 * @author Aldane
 */
public class Form_MainMenu extends javax.swing.JFrame {

    /** Creates new form Form_MainMenu */
    public ArrayList timerComponents = new ArrayList(200);
    public ArrayList transactions = new ArrayList(200);
    public DefaultTableModel table;
    private String password;
    public int terminalNumber=200;
    ResultSet allTerminals;
    public Connection con;
    public javax.swing.JTextField total;
    public JSpinner spinner;
    public float TotalServicePrice=0;
    public JTable terminalTable;
    public static ArrayList timerComponentsStatic;
    
    public Form_MainMenu()
    {
      ReadProperty();
        initComponents();
        int vColIndex = 0;
        TableColumn col = TerminalsTable.getColumnModel().getColumn(vColIndex);
        int width = 1;
       col.setPreferredWidth(width);
       ButtonGroup buttonGroup = new ButtonGroup();
       buttonGroup.add(ExtendTime);
       buttonGroup.add(ChangeToOpenTime);
       table=(DefaultTableModel)TerminalsTable.getModel();
       setTerminals();
        for(int i=0; i<=terminalNumber;i++){
        TimerComponent timer=new TimerComponent(TerminalsTable,i,this);
        timerComponents.add(i,timer);
        }
        for(int i=0; i<=terminalNumber;i++){
        DefaultTableModel transactiontable= new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Service", "Quantity", "Price"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.Float.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, false
            };

                @Override
            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

                @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
        transactions.add(transactiontable);
        }
       Integer selected=(Integer)jSpinner1.getValue()-1;
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        String status =(String)TerminalsTable.getValueAt(selected,1);
        if(timer.inSession){
    TerminalStart.setEnabled(false);
    TerminalExtend.setEnabled(true);
        }
        else if(status.equals("Available")){
    TerminalStart.setEnabled(true);
    TerminalExtend.setEnabled(false);    
        }
        else{
    TerminalStart.setEnabled(false);
    TerminalExtend.setEnabled(false);
        }
        total=TotalField;
        spinner=jSpinner1;
        terminalTable=TerminalsTable;
        TerminalsTable.setDefaultRenderer(TerminalsTable.getColumnClass(1),new YourTableCellRenderer());
        timerComponentsStatic=timerComponents;
    }
    
     private void ReadProperty(){
    try{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        File f = new File("DatabasePassword.props");
        if(f.exists()){
          Properties pro = new Properties();
          FileInputStream in = new FileInputStream(f);
          pro.load(in);
          password = pro.getProperty("DatabasePassword");	 
        }
        else{
        Properties pro = new Properties();
		pro.setProperty("DatabasePassword", "789123456");
        pro.store(new FileOutputStream("DatabasePassword.props"),null);  
		}
	}         
    catch(IOException e){
    System.out.println(e.getMessage());
    }
  }

    private void setTerminals(){
        try{
        String url ="jdbc:mysql://localhost:3306/matrix";
        con = DriverManager.getConnection(url,"root",password);
        PreparedStatement pstmt= con.prepareStatement("SELECT * FROM terminals");
        allTerminals= pstmt.executeQuery();
       while(allTerminals.next()){
           String num=allTerminals.getString("TerminalNumber");
           String status=allTerminals.getString("TerminalStatus");
           table.addRow(new Object[]{num,status,0F});
        } 
        }
        catch(SQLException ex){
            System.out.println("nada");
        }
        
     
        
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        StartDialog = new javax.swing.JDialog();
        RentalType = new javax.swing.JLabel();
        RentalTypeBox = new javax.swing.JComboBox();
        StartHours = new javax.swing.JSpinner();
        StartHrs = new javax.swing.JLabel();
        StartMins = new javax.swing.JLabel();
        StartOk = new javax.swing.JButton();
        StartCancel = new javax.swing.JButton();
        StartMinute = new javax.swing.JSpinner();
        ExtendDialog = new javax.swing.JDialog();
        ChangeToOpenTime = new javax.swing.JRadioButton();
        ExtendTime = new javax.swing.JRadioButton();
        ExtendHrs = new javax.swing.JLabel();
        ExtendMins = new javax.swing.JLabel();
        ExtendOk = new javax.swing.JButton();
        ExtendCancel = new javax.swing.JButton();
        ExtendHours = new javax.swing.JSpinner();
        ExtendMinutes = new javax.swing.JSpinner();
        jDialog1 = new javax.swing.JDialog();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jSpinner2 = new javax.swing.JSpinner();
        jLabel2 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jDialog2 = new javax.swing.JDialog();
        jLabel4 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        TerminalsTablePane = new javax.swing.JScrollPane();
        TerminalsTable = new javax.swing.JTable();
        TabsPane = new javax.swing.JTabbedPane();
        Status = new javax.swing.JScrollPane();
        StatusTextArea = new javax.swing.JTextArea();
        TerminalTransactionsl = new javax.swing.JPanel();
        TransactionsPane = new javax.swing.JScrollPane();
        TransactionTable = new javax.swing.JTable();
        TerminalCheckout = new javax.swing.JButton();
        AddServiceToTerminal = new javax.swing.JButton();
        DeleteAdditService = new javax.swing.JButton();
        Total = new javax.swing.JLabel();
        TotalField = new javax.swing.JTextField();
        OtherTransactions = new javax.swing.JPanel();
        TransactionsLabel = new javax.swing.JLabel();
        ServicesPane = new javax.swing.JScrollPane();
        ServicesTable = new javax.swing.JTable();
        OtherTransactionsSeparator = new javax.swing.JSeparator();
        TransactionInfo = new javax.swing.JLabel();
        Checkout = new javax.swing.JButton();
        AddService = new javax.swing.JButton();
        DeleteService = new javax.swing.JButton();
        TotalField1 = new javax.swing.JTextField();
        Total1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        TerminalStart = new javax.swing.JButton();
        TerminalStop = new javax.swing.JButton();
        TerminalExtend = new javax.swing.JButton();
        jSpinner1 = new javax.swing.JSpinner();
        jLabel1 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        MenuBar = new javax.swing.JMenuBar();
        Menu = new javax.swing.JMenu();
        AdministratorOptions = new javax.swing.JMenuItem();
        ChangeAdminPassord = new javax.swing.JMenuItem();
        Separator2 = new javax.swing.JPopupMenu.Separator();
        Exit = new javax.swing.JMenuItem();

        StartDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        StartDialog.setTitle("Start");
        StartDialog.setAlwaysOnTop(true);
        StartDialog.setIconImage(null);
        StartDialog.setMinimumSize(new java.awt.Dimension(299, 245));
        StartDialog.setName("StartDialog"); // NOI18N
        StartDialog.setResizable(false);

        RentalType.setFont(new java.awt.Font("Tahoma", 0, 14));
        RentalType.setText("Rental Type:");

        RentalTypeBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Open Time", "Fixed" }));
        RentalTypeBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RentalTypeBoxActionPerformed(evt);
            }
        });

        StartHours.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        StartHrs.setFont(new java.awt.Font("Tahoma", 0, 12));
        StartHrs.setText("Hours:");

        StartMins.setFont(new java.awt.Font("Tahoma", 0, 12));
        StartMins.setText("Minuites:");

        StartOk.setText("Ok");
        StartOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                StartOkActionPerformed(evt);
            }
        });

        StartCancel.setText("Cancel");
        StartCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                StartCancelActionPerformed(evt);
            }
        });

        StartMinute.setModel(new javax.swing.SpinnerNumberModel(0, 0, 59, 1));

        javax.swing.GroupLayout StartDialogLayout = new javax.swing.GroupLayout(StartDialog.getContentPane());
        StartDialog.getContentPane().setLayout(StartDialogLayout);
        StartDialogLayout.setHorizontalGroup(
            StartDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(StartDialogLayout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addGroup(StartDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(StartDialogLayout.createSequentialGroup()
                        .addComponent(RentalType)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(RentalTypeBox, 0, 139, Short.MAX_VALUE))
                    .addGroup(StartDialogLayout.createSequentialGroup()
                        .addComponent(StartOk, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 162, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, StartDialogLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(StartCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(StartDialogLayout.createSequentialGroup()
                        .addComponent(StartHrs, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(StartHours, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(StartMins)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(StartMinute, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(29, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        StartDialogLayout.setVerticalGroup(
            StartDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(StartDialogLayout.createSequentialGroup()
                .addGroup(StartDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(StartDialogLayout.createSequentialGroup()
                        .addGap(52, 52, 52)
                        .addComponent(RentalType))
                    .addGroup(StartDialogLayout.createSequentialGroup()
                        .addGap(49, 49, 49)
                        .addComponent(RentalTypeBox, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(30, 30, 30)
                .addGroup(StartDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(StartHrs)
                    .addComponent(StartMins)
                    .addComponent(StartHours, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(StartMinute, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32)
                .addGroup(StartDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(StartCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(StartOk, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(50, 50, 50))
        );

        ExtendDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        ExtendDialog.setTitle("Extend Time");
        ExtendDialog.setMinimumSize(new java.awt.Dimension(284, 229));
        ExtendDialog.setResizable(false);

        ChangeToOpenTime.setFont(new java.awt.Font("Tahoma", 0, 14));
        ChangeToOpenTime.setText("Change To Open Time");
        ChangeToOpenTime.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ChangeToOpenTimeActionPerformed(evt);
            }
        });

        ExtendTime.setFont(new java.awt.Font("Tahoma", 0, 14));
        ExtendTime.setSelected(true);
        ExtendTime.setText("Extend Time");
        ExtendTime.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExtendTimeActionPerformed(evt);
            }
        });

        ExtendHrs.setFont(new java.awt.Font("Tahoma", 0, 12));
        ExtendHrs.setText("Hours:");

        ExtendMins.setFont(new java.awt.Font("Tahoma", 0, 12));
        ExtendMins.setText("Minutes:");

        ExtendOk.setText("Ok");
        ExtendOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExtendOkActionPerformed(evt);
            }
        });

        ExtendCancel.setText("Cancel");
        ExtendCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExtendCancelActionPerformed(evt);
            }
        });

        ExtendHours.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        ExtendMinutes.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        javax.swing.GroupLayout ExtendDialogLayout = new javax.swing.GroupLayout(ExtendDialog.getContentPane());
        ExtendDialog.getContentPane().setLayout(ExtendDialogLayout);
        ExtendDialogLayout.setHorizontalGroup(
            ExtendDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ExtendDialogLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(ExtendDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ExtendDialogLayout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addGroup(ExtendDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(ExtendCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(ExtendDialogLayout.createSequentialGroup()
                                .addComponent(ExtendHrs)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(ExtendHours, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(ExtendMins)
                                .addGap(18, 18, 18)
                                .addComponent(ExtendMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(ChangeToOpenTime)
                    .addComponent(ExtendTime))
                .addContainerGap(13, Short.MAX_VALUE))
            .addGroup(ExtendDialogLayout.createSequentialGroup()
                .addGap(48, 48, 48)
                .addComponent(ExtendOk, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(177, Short.MAX_VALUE))
        );
        ExtendDialogLayout.setVerticalGroup(
            ExtendDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ExtendDialogLayout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(ExtendTime)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(ExtendDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ExtendHours, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ExtendMins)
                    .addComponent(ExtendMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ExtendHrs))
                .addGap(18, 18, 18)
                .addComponent(ChangeToOpenTime)
                .addGap(44, 44, 44)
                .addGroup(ExtendDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ExtendOk, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ExtendCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(30, 30, 30))
        );

        jDialog1.setResizable(false);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Service #", "Service Name", "Price"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.Float.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jSpinner2.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jLabel2.setText("Quantity:");

        jButton1.setText("Add Service");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Cancel");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
        jDialog1.getContentPane().setLayout(jDialog1Layout);
        jDialog1Layout.setHorizontalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jDialog1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );
        jDialog1Layout.setVerticalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jDialog2.setResizable(false);

        jLabel4.setText("Are you sure you want to check out customer?");

        jButton3.setText("Yes");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("No");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialog2Layout = new javax.swing.GroupLayout(jDialog2.getContentPane());
        jDialog2.getContentPane().setLayout(jDialog2Layout);
        jDialog2Layout.setHorizontalGroup(
            jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDialog2Layout.createSequentialGroup()
                .addGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jDialog2Layout.createSequentialGroup()
                        .addGap(78, 78, 78)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                        .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jDialog2Layout.createSequentialGroup()
                        .addContainerGap(90, Short.MAX_VALUE)
                        .addComponent(jLabel4)))
                .addGap(86, 86, 86))
        );
        jDialog2Layout.setVerticalGroup(
            jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog2Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton3)
                    .addComponent(jButton4))
                .addContainerGap(37, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Matrix");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setName("MainFrame"); // NOI18N
        setResizable(false);

        TerminalsTable.setFont(new java.awt.Font("Arial", 0, 18));
        TerminalsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Terminal #", "Time Elapsed", "Price"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.Float.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        TerminalsTable.setRowHeight(35);
        TerminalsTable.getTableHeader().setReorderingAllowed(false);
        TerminalsTablePane.setViewportView(TerminalsTable);

        TabsPane.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
        TabsPane.setName("Status Ticker"); // NOI18N
        TabsPane.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                TabsPaneStateChanged(evt);
            }
        });

        StatusTextArea.setColumns(20);
        StatusTextArea.setFont(new java.awt.Font("Arial", 0, 13));
        StatusTextArea.setRows(5);
        StatusTextArea.setText("Tick");
        StatusTextArea.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        StatusTextArea.setEnabled(false);
        Status.setViewportView(StatusTextArea);

        TabsPane.addTab("Status Ticker", Status);

        TransactionTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Service", "Quantity", "Price"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.Float.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        TransactionTable.getTableHeader().setReorderingAllowed(false);
        TransactionsPane.setViewportView(TransactionTable);

        TerminalCheckout.setText("Checkout");
        TerminalCheckout.setEnabled(false);
        TerminalCheckout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TerminalCheckoutActionPerformed(evt);
            }
        });

        AddServiceToTerminal.setText("Add");
        AddServiceToTerminal.setToolTipText("Add Service");
        AddServiceToTerminal.setEnabled(false);
        AddServiceToTerminal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddServiceToTerminalActionPerformed(evt);
            }
        });

        DeleteAdditService.setText("Delete");
        DeleteAdditService.setEnabled(false);
        DeleteAdditService.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DeleteAdditServiceActionPerformed(evt);
            }
        });

        Total.setFont(new java.awt.Font("Tahoma", 0, 18));
        Total.setText("Total: PHP");

        TotalField.setEditable(false);
        TotalField.setFont(new java.awt.Font("Tahoma", 0, 14));
        TotalField.setText("0");
        TotalField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TotalFieldActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout TerminalTransactionslLayout = new javax.swing.GroupLayout(TerminalTransactionsl);
        TerminalTransactionsl.setLayout(TerminalTransactionslLayout);
        TerminalTransactionslLayout.setHorizontalGroup(
            TerminalTransactionslLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TerminalTransactionslLayout.createSequentialGroup()
                .addGroup(TerminalTransactionslLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(TerminalTransactionslLayout.createSequentialGroup()
                        .addGap(108, 108, 108)
                        .addComponent(Total)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(TotalField, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(TerminalTransactionslLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(AddServiceToTerminal)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(DeleteAdditService)
                        .addGap(69, 69, 69)
                        .addComponent(TerminalCheckout))
                    .addGroup(TerminalTransactionslLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(TransactionsPane, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)))
                .addContainerGap())
        );
        TerminalTransactionslLayout.setVerticalGroup(
            TerminalTransactionslLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TerminalTransactionslLayout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(TransactionsPane, javax.swing.GroupLayout.PREFERRED_SIZE, 458, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(TerminalTransactionslLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Total)
                    .addComponent(TotalField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13)
                .addGroup(TerminalTransactionslLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TerminalCheckout)
                    .addComponent(AddServiceToTerminal)
                    .addComponent(DeleteAdditService))
                .addContainerGap())
        );

        TabsPane.addTab("Terminal Transactions", null, TerminalTransactionsl, "Transactions from customers that are registered to terminals.");

        TransactionsLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        TransactionsLabel.setText("Other Transaction:");

        ServicesTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Service", "Quantity", "Price"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class, java.lang.Float.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        ServicesTable.getTableHeader().setReorderingAllowed(false);
        ServicesPane.setViewportView(ServicesTable);

        TransactionInfo.setText("Transaction Info:");

        Checkout.setText("Checkout");
        Checkout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckoutActionPerformed(evt);
            }
        });

        AddService.setText("Add");
        AddService.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddServiceActionPerformed(evt);
            }
        });

        DeleteService.setText("Delete");
        DeleteService.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DeleteServiceActionPerformed(evt);
            }
        });

        TotalField1.setEditable(false);
        TotalField1.setFont(new java.awt.Font("Tahoma", 0, 14));
        TotalField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TotalField1ActionPerformed(evt);
            }
        });

        Total1.setFont(new java.awt.Font("Tahoma", 0, 18));
        Total1.setText("Total: PHP");

        jLabel3.setText("Customer Name:");

        javax.swing.GroupLayout OtherTransactionsLayout = new javax.swing.GroupLayout(OtherTransactions);
        OtherTransactions.setLayout(OtherTransactionsLayout);
        OtherTransactionsLayout.setHorizontalGroup(
            OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(OtherTransactionsLayout.createSequentialGroup()
                .addGroup(OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(OtherTransactionsLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ServicesPane, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)
                            .addComponent(TransactionsLabel)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, OtherTransactionsLayout.createSequentialGroup()
                                .addComponent(AddService)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(DeleteService)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
                                .addComponent(Checkout))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, OtherTransactionsLayout.createSequentialGroup()
                                .addComponent(Total1)
                                .addGap(18, 18, 18)
                                .addComponent(TotalField1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(OtherTransactionsSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)
                            .addComponent(TransactionInfo)))
                    .addGroup(OtherTransactionsLayout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jLabel3)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        OtherTransactionsLayout.setVerticalGroup(
            OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(OtherTransactionsLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(TransactionsLabel)
                .addGap(18, 18, 18)
                .addGroup(OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(40, 40, 40)
                .addComponent(OtherTransactionsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(TransactionInfo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ServicesPane, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TotalField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Total1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(OtherTransactionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Checkout)
                    .addComponent(AddService)
                    .addComponent(DeleteService))
                .addContainerGap())
        );

        TabsPane.addTab("Other ", null, OtherTransactions, "Other transactions from customers with no terminals.");

        TerminalStart.setText("Start");
        TerminalStart.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TerminalStartActionPerformed(evt);
            }
        });

        TerminalStop.setText("Stop");
        TerminalStop.setEnabled(false);
        TerminalStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TerminalStopActionPerformed(evt);
            }
        });

        TerminalExtend.setText("Extend");
        TerminalExtend.setToolTipText("Extend Rental Time");
        TerminalExtend.setEnabled(false);
        TerminalExtend.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TerminalExtendActionPerformed(evt);
            }
        });

        jSpinner1.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));
        jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinner1StateChanged(evt);
            }
        });

        jLabel1.setText("Terminal Selected:");

        jButton5.setText("Cancel");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        Menu.setText("Menu");

        AdministratorOptions.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
        AdministratorOptions.setText("Administrator Options");
        AdministratorOptions.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                AdministratorOptionsMouseClicked(evt);
            }
        });
        AdministratorOptions.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AdministratorOptionsActionPerformed(evt);
            }
        });
        Menu.add(AdministratorOptions);

        ChangeAdminPassord.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
        ChangeAdminPassord.setText("Change Admin Password");
        ChangeAdminPassord.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ChangeAdminPassordActionPerformed(evt);
            }
        });
        Menu.add(ChangeAdminPassord);
        Menu.add(Separator2);

        Exit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        Exit.setText("Quit");
        Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExitActionPerformed(evt);
            }
        });
        Menu.add(Exit);

        MenuBar.add(Menu);

        setJMenuBar(MenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(TerminalStart, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5)
                        .addComponent(TerminalStop, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TerminalExtend, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 230, Short.MAX_VALUE)
                        .addComponent(jButton5))
                    .addComponent(TerminalsTablePane, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TabsPane, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TerminalStop, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TerminalStart, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TerminalExtend, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(TabsPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TerminalsTablePane, javax.swing.GroupLayout.DEFAULT_SIZE, 577, Short.MAX_VALUE)))
                .addContainerGap())
        );

        TabsPane.getAccessibleContext().setAccessibleName("Status Ticker");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void DeleteAdditServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteAdditServiceActionPerformed
        // TODO add your handling code here:
    Integer selected=(Integer)jSpinner1.getValue()-1;
    DefaultTableModel tableGet=(DefaultTableModel)transactions.get(selected);
    Integer get=TransactionTable.getSelectedRow();
    float price=(Float)tableGet.getValueAt(get,2);
    TimerComponent timer = (TimerComponent)timerComponents.get(selected+1);
    timer.serviceprice=timer.serviceprice-price;
    tableGet.removeRow(get);
    }//GEN-LAST:event_DeleteAdditServiceActionPerformed

    private void TerminalStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TerminalStartActionPerformed
        Integer selected=(Integer)jSpinner1.getValue();
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        if(!timer.inSession){
        this.StartDialog.setVisible(true);
        Calendar cal = Calendar.getInstance();
        String am_pm;
        int hours = cal.get(Calendar.HOUR);
        int minutes = cal.get(Calendar.MINUTE);
        int seconds = cal.get(Calendar.SECOND);
         if(cal.get(Calendar.AM_PM) == 0)
          am_pm = "AM";
          else
        am_pm = "PM";
        timer.timeStarted=hours + ":" + minutes + ":" + seconds + " " + am_pm;
        try{
    PreparedStatement pstmt3= con.prepareStatement("SELECT * FROM rates");
        ResultSet getStatus=pstmt3.executeQuery();
        getStatus.next();
         timer.rates = getStatus.getInt("rate");
    }
    catch(SQLException ex){
            System.out.println("nada");
        }   
    
        }
        else{
        timer.setTimer(true);
        timer.isPaused=false;
        TerminalStart.setEnabled(false);
        if(timer.isFixed)TerminalExtend.setEnabled(true);
        else TerminalExtend.setEnabled(false);
        }
    }//GEN-LAST:event_TerminalStartActionPerformed

    private void TotalFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TotalFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TotalFieldActionPerformed

    private void TotalField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TotalField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TotalField1ActionPerformed

    private void ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitActionPerformed

        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_ExitActionPerformed

    private void StartOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StartOkActionPerformed
        // TODO add your handling code here:
        TerminalStop.setEnabled(true);
        String type=(String)RentalTypeBox.getSelectedItem();
        if(type.equals("Open Time")){
        Integer selected=(Integer)jSpinner1.getValue();
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        timer.setTimer(true);
        timer.inSession=true;
        this.StartDialog.setVisible(false);
        TerminalStart.setEnabled(false);
        TerminalExtend.setEnabled(false);
        }
        else if(type.equals("Fixed")){
        Integer selected=(Integer)jSpinner1.getValue();
        Integer hour=(Integer)StartHours.getValue();
        Integer minute=(Integer)StartMinute.getValue();
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        timer.setFixedTime(hour, minute);
        this.StartDialog.setVisible(false);
        timer.inSession=true;
        TerminalStart.setEnabled(false);
        TerminalExtend.setEnabled(true);
        }
        TerminalCheckout.setEnabled(true);
        AddServiceToTerminal.setEnabled(true);
        DeleteAdditService.setEnabled(true);
    }//GEN-LAST:event_StartOkActionPerformed

    private void ChangeToOpenTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ChangeToOpenTimeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ChangeToOpenTimeActionPerformed

    private void ExtendOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExtendOkActionPerformed
        // TODO add your handling code here:
        if(ChangeToOpenTime.isSelected()){
        Integer selected=(Integer)jSpinner1.getValue();
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        timer.hour=0;
        timer.minute=0;
        timer.second=0;
        timer.isFixed=false;
        this.ExtendDialog.setVisible(false);
        TerminalExtend.setEnabled(false);
        }
        else if(ExtendTime.isSelected()){
        Integer selected=(Integer)jSpinner1.getValue();
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        timer.hour=timer.hour+(Integer)ExtendHours.getValue();
        timer.minute=timer.minute+(Integer)ExtendMinutes.getValue();
        timer.setTimer(true);
        this.ExtendDialog.setVisible(false);
        }
        
    }//GEN-LAST:event_ExtendOkActionPerformed

    private void ExtendCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExtendCancelActionPerformed
        this.ExtendDialog.dispose();
    }//GEN-LAST:event_ExtendCancelActionPerformed

    private void StartCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StartCancelActionPerformed
        this.StartDialog.dispose();
    }//GEN-LAST:event_StartCancelActionPerformed

    private void ChangeAdminPassordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ChangeAdminPassordActionPerformed
    Form_ChangePassword ChangePasswordWindow = new Form_ChangePassword(this);
        ChangePasswordWindow.setVisible(true);
    }//GEN-LAST:event_ChangeAdminPassordActionPerformed

private void RentalTypeBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RentalTypeBoxActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_RentalTypeBoxActionPerformed

private void TerminalExtendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TerminalExtendActionPerformed
    this.ExtendDialog.setVisible(true); 
}//GEN-LAST:event_TerminalExtendActionPerformed

private void TerminalStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TerminalStopActionPerformed
// TODO add your handling code here:
     Integer selected=(Integer)jSpinner1.getValue();
     String status =(String)TerminalsTable.getValueAt(selected-1,1);
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        timer.setTimer(false);
        timer.isPaused=true;
       if(status.equals("Available") || timer.inSession){
    TerminalStart.setEnabled(true);
    TerminalExtend.setEnabled(false); 
       }
}//GEN-LAST:event_TerminalStopActionPerformed

private void ExtendTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExtendTimeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_ExtendTimeActionPerformed

private void AdministratorOptionsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AdministratorOptionsMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_AdministratorOptionsMouseClicked

private void AdministratorOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AdministratorOptionsActionPerformed
// TODO add your handling code here:
    Form_MainMenu menu = this;
     Form_PasswordCheck frame = new Form_PasswordCheck(menu);
    frame.show(true);
}//GEN-LAST:event_AdministratorOptionsActionPerformed

private void jSpinner1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner1StateChanged
// TODO add your handling code here:
    if(table.getRowCount()<(Integer)jSpinner1.getValue())jSpinner1.setValue(table.getRowCount());
    Integer selected=(Integer)jSpinner1.getValue()-1;
        TimerComponent timer = (TimerComponent)timerComponents.get(selected+1);
        String status =(String)TerminalsTable.getValueAt(selected,1);
        if(timer.inSession && !timer.isPaused && timer.isFixed){
    TerminalStart.setEnabled(false);
    TerminalExtend.setEnabled(true);
        }
        else if(status.equals("Available") || timer.isPaused){
    TerminalStart.setEnabled(true);
    TerminalExtend.setEnabled(false);    
        }
        else{
    TerminalStart.setEnabled(false);
    TerminalExtend.setEnabled(false);
        }
      TransactionTable.setModel((TableModel)transactions.get(selected));
      
      if(timer.inSession){
      TerminalCheckout.setEnabled(true);
        AddServiceToTerminal.setEnabled(true);
        DeleteAdditService.setEnabled(true);
      }
      else{
      TerminalCheckout.setEnabled(false);
        AddServiceToTerminal.setEnabled(false);
        DeleteAdditService.setEnabled(false);}
      
}//GEN-LAST:event_jSpinner1StateChanged

private void AddServiceToTerminalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddServiceToTerminalActionPerformed
// TODO add your handling code here:
     this.jDialog1.setVisible(true); 
     this.jDialog1.setSize(400, 250);
      
     try{
        PreparedStatement pstmt= con.prepareStatement("SELECT * FROM services");
        ResultSet all= pstmt.executeQuery();
        DefaultTableModel tableGet=(DefaultTableModel)jTable1.getModel();
        while(tableGet.getRowCount()!=0){
           tableGet.removeRow(0); 
       }
       while(all.next()){
           Integer serviceCode=all.getInt("ServiceCode");
           String nameGet=all.getString("ServiceName");
           Float price = all.getFloat("ServicePrice");
           boolean active = all.getBoolean("StatusBoolean");
           if(active)
           tableGet.addRow(new Object[]{serviceCode,nameGet,price});
        } 
        }
        catch(SQLException ex){
            System.out.println("nada");
        }
}//GEN-LAST:event_AddServiceToTerminalActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
    jDialog1.setVisible(false);
}//GEN-LAST:event_jButton2ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
    
    if(TabsPane.getSelectedIndex()==1){
    Integer get=jTable1.getSelectedRow();
    Integer selected=(Integer)jSpinner1.getValue()-1;
    Integer x=(Integer)jSpinner2.getValue();
    String nameGet=(String)jTable1.getValueAt(get,1);
    float price=(Float)jTable1.getValueAt(get,2);
    float totalPrice=price*x;
    DefaultTableModel getModel=(DefaultTableModel)transactions.get(selected);
    getModel.addRow(new Object[]{nameGet,x,totalPrice});
    TimerComponent timer = (TimerComponent)timerComponents.get(selected+1);
    timer.serviceprice=timer.serviceprice+totalPrice;
    TransactionTable.setModel((TableModel)transactions.get(selected));
    }
    else{
    Integer get=jTable1.getSelectedRow();
    Integer x=(Integer)jSpinner2.getValue();
    String nameGet=(String)jTable1.getValueAt(get,1);
    float price=(Float)jTable1.getValueAt(get,2);
    float totalPrice=price*x;
    TotalServicePrice=TotalServicePrice+totalPrice;
    TotalField1.setText(Float.toString(TotalServicePrice));
    DefaultTableModel getModel=(DefaultTableModel)ServicesTable.getModel();
    getModel.addRow(new Object[]{nameGet,x,totalPrice});
    }
}//GEN-LAST:event_jButton1ActionPerformed

private void TerminalCheckoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TerminalCheckoutActionPerformed
// TODO add your handling code here:
    this.jDialog2.setVisible(true);
    jDialog2.setSize(380,150);
}//GEN-LAST:event_TerminalCheckoutActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
    this.jDialog2.dispose();
}//GEN-LAST:event_jButton4ActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
Calendar cal = Calendar.getInstance();
int day = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR);
int dow = cal.get(Calendar.DAY_OF_WEEK);
int dom = cal.get(Calendar.DAY_OF_MONTH);
int doy = cal.get(Calendar.DAY_OF_YEAR);
String am_pm;
  int hour = cal.get(Calendar.HOUR);
  int minute = cal.get(Calendar.MINUTE);
  int second = cal.get(Calendar.SECOND);
  if(cal.get(Calendar.AM_PM) == 0)
  am_pm = "AM";
  else
  am_pm = "PM";
  System.out.println("Current Time : " + hour + ":" 
+ minute + ":" + second + " " + am_pm);
System.out.println("Day: " + day);
System.out.println("Month: " + month);
System.out.println("Year: " + year);
System.out.println("Day of Week: " + dow);
System.out.println("Day of Month: " + dom);
System.out.println("Day of Year: " + doy);
if(TabsPane.getSelectedIndex()==1){
Integer selected=(Integer)jSpinner1.getValue();
TimerComponent timer = (TimerComponent)timerComponents.get(selected);

int rentalID=0;
try{
        PreparedStatement pstmt= con.prepareStatement("SELECT * FROM terminalrental");
        ResultSet id= pstmt.executeQuery();
       while(id.next()){
            rentalID=id.getInt("RentalID");
        } 
        }
        catch(SQLException ex){
            System.out.println("nada");
        }

  try{
        System.out.println("Add");
        PreparedStatement pstmt =
             con.prepareStatement("INSERT INTO `terminalrental` (`RentalID`, `TerminalNumber`, `TotalPrice`, `StartTime`, `EndTime`, `RentalType`, `Duration`, `day`, `month`, `year`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
            //append values for the parameters
            int i=1;
            pstmt.setInt(i++, rentalID+1);
            pstmt.setInt(i++, selected);
            pstmt.setFloat(i++, timer.price);
            pstmt.setString(i++, timer.timeStarted);
            pstmt.setString(i++, hour + ":" 
+ minute + ":" + second + " " + am_pm);
            if(timer.isFixed){
            pstmt.setString(i++, "Fixed");
             int totalhour=timer.Sethour-timer.hour;
             int totalminute=timer.Setminute-timer.minute;
            pstmt.setString(i++, "Hours/Minutes: "+totalhour+":"+totalminute);
            }
            else{
            pstmt.setString(i++, "Open Time"); 
            pstmt.setString(i++, "Hours/Minutes: "+timer.hour + ":" + timer.minute);
            }
            pstmt.setInt(i++, day);
            pstmt.setInt(i++, month);
            pstmt.setInt(i++, year);
            pstmt.executeUpdate(); 
  }
  
  catch(SQLException ex){
            System.out.println("nada");
             System.err.println("SQLState: " + ((SQLException)ex).getSQLState());
          System.err.println("Error Code: " + ((SQLException)ex).getErrorCode());
          System.err.println("Message: " + ex.getMessage());
        }
System.out.println(timer.computerNo);
TerminalStart.setEnabled(true);
TerminalExtend.setEnabled(false);  
timer.resetTimer();

 int transactionID=0;
try{
        PreparedStatement pstmt= con.prepareStatement("SELECT * FROM customer");
        ResultSet id= pstmt.executeQuery();
       while(id.next()){
            transactionID=id.getInt("TransactionID");
            System.out.println(transactionID);
        } 
        }
        catch(SQLException ex){
            System.out.println("Didn't Get next ID");
        }
    
    
    DefaultTableModel tableGet=(DefaultTableModel)TransactionTable.getModel();
    String name="Terminal # "+selected;
    while(tableGet.getRowCount()>0){
    String ServiceName=(String)tableGet.getValueAt(0,0);
    float price=(Float)tableGet.getValueAt(0,2);
    
    
     try{
        System.out.println("Add");
        PreparedStatement pstmt =
             con.prepareStatement("INSERT INTO `customer` (`TransactionID`,`CustomerName`,`ServiceName`, `ServiceTotal`, `Day`, `Month`, `Year`) VALUES (?, ?, ?, ?, ?, ?, ?)");
            //append values for the parameters
            int i=1;
            transactionID++;
            pstmt.setInt(i++, transactionID);
            pstmt.setString(i++, name); 
            pstmt.setString(i++, ServiceName); 
            pstmt.setFloat(i++, price);
            pstmt.setInt(i++, day);
            pstmt.setInt(i++, month);
            pstmt.setInt(i++, year);
            pstmt.executeUpdate(); 
  }
  
  catch(SQLException ex){
            System.out.println("nada");
             System.err.println("SQLState: " + ((SQLException)ex).getSQLState());
          System.err.println("Error Code: " + ((SQLException)ex).getErrorCode());
          System.err.println("Message: " + ex.getMessage());
        }
    
    
    tableGet.removeRow(0);
    }
    TotalField1.setText("0");
    TotalServicePrice=0;








}

else{
    int transactionID=0;
try{
        PreparedStatement pstmt= con.prepareStatement("SELECT * FROM customer");
        ResultSet id= pstmt.executeQuery();
       while(id.next()){
            transactionID=id.getInt("TransactionID");
            System.out.println(transactionID);
        } 
        }
        catch(SQLException ex){
            System.out.println("Didn't Get next ID");
        }
    
    
    DefaultTableModel tableGet=(DefaultTableModel)ServicesTable.getModel();
    String name=(String)jTextField1.getText();
    while(tableGet.getRowCount()>0){
    String ServiceName=(String)tableGet.getValueAt(0,0);
    float price=(Float)tableGet.getValueAt(0,2);
    
    
     try{
        System.out.println("Add");
        PreparedStatement pstmt =
             con.prepareStatement("INSERT INTO `customer` (`TransactionID`,`CustomerName`,`ServiceName`, `ServiceTotal`, `Day`, `Month`, `Year`) VALUES (?, ?, ?, ?, ?, ?, ?)");
            //append values for the parameters
            int i=1;
            transactionID++;
            pstmt.setInt(i++, transactionID);
            pstmt.setString(i++, name); 
            pstmt.setString(i++, ServiceName); 
            pstmt.setFloat(i++, price);
            pstmt.setInt(i++, day);
            pstmt.setInt(i++, month);
            pstmt.setInt(i++, year);
            pstmt.executeUpdate(); 
  }
  
  catch(SQLException ex){
            System.out.println("nada");
             System.err.println("SQLState: " + ((SQLException)ex).getSQLState());
          System.err.println("Error Code: " + ((SQLException)ex).getErrorCode());
          System.err.println("Message: " + ex.getMessage());
        }
    
    
    tableGet.removeRow(0);
    }
    TotalField1.setText("0");
    TotalServicePrice=0;
}

jDialog2.dispose();
}//GEN-LAST:event_jButton3ActionPerformed

private void AddServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddServiceActionPerformed
// TODO add your handling code here:
    this.jDialog1.setVisible(true); 
     this.jDialog1.setSize(400, 250);
      
     try{
        PreparedStatement pstmt= con.prepareStatement("SELECT * FROM services");
        ResultSet all= pstmt.executeQuery();
        DefaultTableModel tableGet=(DefaultTableModel)jTable1.getModel();
        while(tableGet.getRowCount()!=0){
           tableGet.removeRow(0); 
       }
       while(all.next()){
           Integer serviceCode=all.getInt("ServiceCode");
           String nameGet=all.getString("ServiceName");
           Float price = all.getFloat("ServicePrice");
           boolean active = all.getBoolean("StatusBoolean");
           if(active)
           tableGet.addRow(new Object[]{serviceCode,nameGet,price});
        } 
        }
        catch(SQLException ex){
            System.out.println("nada");
        }
}//GEN-LAST:event_AddServiceActionPerformed

private void DeleteServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteServiceActionPerformed
DefaultTableModel tableGet=(DefaultTableModel)ServicesTable.getModel();
    Integer get=ServicesTable.getSelectedRow();
    float price=(Float)tableGet.getValueAt(get,2);
    TotalServicePrice=TotalServicePrice-price;
    TotalField1.setText(Float.toString(TotalServicePrice));
    tableGet.removeRow(get);// TODO add your handling code here:
}//GEN-LAST:event_DeleteServiceActionPerformed

private void TabsPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_TabsPaneStateChanged
// TODO add your handling code here:
    jDialog1.dispose();
}//GEN-LAST:event_TabsPaneStateChanged

private void CheckoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckoutActionPerformed
// TODO add your handling code here:
   jDialog2.setVisible(true);
   jDialog2.setSize(380,150);
}//GEN-LAST:event_CheckoutActionPerformed

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
 Integer selected=(Integer)jSpinner1.getValue();
        TimerComponent timer = (TimerComponent)timerComponents.get(selected);
        timer.resetTimer();// TODO add your handling code here:
        String status =(String)TerminalsTable.getValueAt(selected,1);
        if(timer.inSession && !timer.isPaused && timer.isFixed){
    TerminalStart.setEnabled(false);
    TerminalExtend.setEnabled(true);
        }
        else{
    TerminalStart.setEnabled(false);
    TerminalExtend.setEnabled(false);
        }
      TransactionTable.setModel((TableModel)transactions.get(selected));
      
      if(timer.inSession){
      TerminalCheckout.setEnabled(true);
        AddServiceToTerminal.setEnabled(true);
        DeleteAdditService.setEnabled(true);
      }
      else{
      TerminalCheckout.setEnabled(false);
        AddServiceToTerminal.setEnabled(false);
        DeleteAdditService.setEnabled(false);}
}//GEN-LAST:event_jButton5ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Form_MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Form_MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Form_MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Form_MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
                new Form_MainMenu().setVisible(true);
            }
        });
    }
    
    
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddService;
    private javax.swing.JButton AddServiceToTerminal;
    private javax.swing.JMenuItem AdministratorOptions;
    private javax.swing.JMenuItem ChangeAdminPassord;
    private javax.swing.JRadioButton ChangeToOpenTime;
    private javax.swing.JButton Checkout;
    private javax.swing.JButton DeleteAdditService;
    private javax.swing.JButton DeleteService;
    private javax.swing.JMenuItem Exit;
    private javax.swing.JButton ExtendCancel;
    private javax.swing.JDialog ExtendDialog;
    private javax.swing.JSpinner ExtendHours;
    private javax.swing.JLabel ExtendHrs;
    private javax.swing.JLabel ExtendMins;
    private javax.swing.JSpinner ExtendMinutes;
    private javax.swing.JButton ExtendOk;
    private javax.swing.JRadioButton ExtendTime;
    private javax.swing.JMenu Menu;
    private javax.swing.JMenuBar MenuBar;
    private javax.swing.JPanel OtherTransactions;
    private javax.swing.JSeparator OtherTransactionsSeparator;
    private javax.swing.JLabel RentalType;
    private javax.swing.JComboBox RentalTypeBox;
    private javax.swing.JPopupMenu.Separator Separator2;
    private javax.swing.JScrollPane ServicesPane;
    private javax.swing.JTable ServicesTable;
    private javax.swing.JButton StartCancel;
    private javax.swing.JDialog StartDialog;
    private javax.swing.JSpinner StartHours;
    private javax.swing.JLabel StartHrs;
    private javax.swing.JLabel StartMins;
    private javax.swing.JSpinner StartMinute;
    private javax.swing.JButton StartOk;
    private javax.swing.JScrollPane Status;
    private javax.swing.JTextArea StatusTextArea;
    private javax.swing.JTabbedPane TabsPane;
    private javax.swing.JButton TerminalCheckout;
    private javax.swing.JButton TerminalExtend;
    private javax.swing.JButton TerminalStart;
    private javax.swing.JButton TerminalStop;
    private javax.swing.JPanel TerminalTransactionsl;
    private javax.swing.JTable TerminalsTable;
    private javax.swing.JScrollPane TerminalsTablePane;
    private javax.swing.JLabel Total;
    private javax.swing.JLabel Total1;
    private javax.swing.JTextField TotalField;
    private javax.swing.JTextField TotalField1;
    private javax.swing.JLabel TransactionInfo;
    private javax.swing.JTable TransactionTable;
    private javax.swing.JLabel TransactionsLabel;
    private javax.swing.JScrollPane TransactionsPane;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JDialog jDialog1;
    private javax.swing.JDialog jDialog2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JSpinner jSpinner2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField1;
    // End of variables declaration//GEN-END:variables

}
